$(function(){
	$('.showmap').on('click',function(){
		popup(this)
		
		var map = new AMap.Map('showlocation', {
			resizeEnable: true,
			zoom: 11,
			center: [118.57, 24.82]
		});
	});
	//删除
	$('.delete-list').on('click',function(){
		console.log(1)
		popup(this,"{:url('delete')}");
		
	});
	//启用
	$('.startusing').on('click',function(){
		popup(this,"{:url('state')}");
		
	});
	//禁用
	$('.forbidden').on('click',function(){
		popup(this,"{:url('state')}");
		
	});
	$('.unbind').on('click', function() {
		$('.driver_id').val($(this).closest('tr').data('id'))
		choosecar("{:url('car/index',['op'=>'unbind'])}?driver_id="+$(this).closest('tr').data('id'))
	});
	$('.bind').on('click', function() {
		$('.driver_id').val($(this).closest('tr').data('id'));
		var id = $(this).closest('tr').data('id');
		choosecar("{:url('car/index',['op'=>'bind'])}?driver_id="+$(this).closest('tr').data('id'));
	});
	$('.choose').on('click', function() {
		var index = parent.layer.getFrameIndex(window.name);
		parent.$('.driver').attr("value",$(this).data('name'));
		parent.$('.driver_id').attr("value",$(this).data('id'));
		parent.layer.close(index);

	});
	$('.car_rental').on('click', function() {
		choosecar("{:url('rent/index',['op'=>'search'])}")
	});
})
